export * from './registerGlobComp'
export * from './getSiteConfig'

export function deepFreeze<T>(obj: T): Readonly<T> {
  if (obj && typeof obj === 'object' && !Object.isFrozen(obj)) {
    Object.freeze(obj as Record<string, unknown>)
    const isObject = (value: unknown): value is Record<string, unknown> =>
      value !== null && typeof value === 'object'

    for (const key in obj) {
      if (isObject((obj as any)[key])) {
        deepFreeze((obj as any)[key])
      }
    }
  }
  return obj
}
